const context = require.context('./', true, /\/index\.tsx?$/);
let allModule = {};
context.keys().map((key) => {
	let match = key.match(/.\/(.*?)\/index.tsx/);
	if (match && match[1]) {
		let reKey = match[1].slice(0, 1).toLocaleLowerCase() + match[1].slice(1);
		let submodule = context(key).Submodule || {};
		submodule.name && (allModule[reKey] = submodule);
	}
});
export default allModule;
